//
//  BLWashCollectionViewCell.m
//  blanket
//
//  Created by Mac on 2017/12/7.
//  Copyright © 2017年 stoneobs@icloud.com. All rights reserved.
//

#import "BLQingdanTableViewCell.h"
@interface BLQingdanTableViewCell()
@property(nonatomic, strong) STLabel                 *nameLable;
@property(nonatomic, strong) STLabel                     *cateLable;
@property(nonatomic, strong) STLabel                     *shuxingLable;
@property(nonatomic, strong) STLabel                     *numLable;
@property(nonatomic, strong) STLabel                     *priceLable;
@property(nonatomic, strong) STLabel                     *noteLable;
@end
@implementation BLQingdanTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self configSubView];
    }
    return self;
}
+ (CGFloat)cellHeight{
    return 44;
}
#pragma mark --subView
- (void)configSubView{
    
    NSArray * array = @[@"名称",@"类别",@"属性",@"数量",@"单价",@"备注"];
    CGFloat with = UIScreenWidth / array.count;
    
    
    self.nameLable = [self defultLableShowRightLine:YES];
    self.nameLable.left = 0;
    [self addSubview:self.nameLable];
    
    self.cateLable = [self defultLableShowRightLine:YES];
    self.cateLable.left = 1 * with;
    [self addSubview:self.cateLable];
    
    
    self.shuxingLable = [self defultLableShowRightLine:YES];
    self.shuxingLable.left =2 * with;;
    [self addSubview:self.shuxingLable];
    
    
    self.numLable = [self defultLableShowRightLine:YES];
    self.numLable.left = 3 * with;;
    [self addSubview:self.numLable];
    
    
    self.priceLable = [self defultLableShowRightLine:YES];
    self.priceLable.left = 4 * with;;
    [self addSubview:self.priceLable];
    
    
    self.noteLable = [self defultLableShowRightLine:YES];
    self.noteLable.left = 5 * with;;
    [self addSubview:self.noteLable];
   
}
- (STLabel*)defultLableShowRightLine:(BOOL)shouldShow{
    NSArray * array = @[@"名称",@"类别",@"属性",@"数量",@"单价",@"备注"];
    CGFloat with = UIScreenWidth / array.count;
    STLabel * titleLable = [[STLabel alloc] initWithFrame:CGRectMake(0, 0, with, [BLQingdanTableViewCell cellHeight])
                                                     text:@"11"
                                                textColor:BL_secendTextColor
                                                     font:12
                                              isSizetoFit:NO
                                            textAlignment:NSTextAlignmentCenter];
    [titleLable st_showBottomLine];
    if (shouldShow) {
        [titleLable st_showRightLine:titleLable.height];
    }
    return titleLable;
    
}
- (void)setWashModel:(BLWashModel *)washModel{
    _washModel = washModel;
    self.nameLable.text = washModel.name;
    self.cateLable.text = washModel.cate_Name;
    self.shuxingLable.text = washModel.washName;
    self.numLable.text = washModel.num;
    self.priceLable.text = washModel.price;
    self.noteLable.text = washModel.note;
}
@end

